﻿@using System.Web.UI.WebControls
@model IEnumerable<DevWeb.Biztalk.DeploymentSettings.WebUI.Models.IntegrationVersionViewModel>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>



@if (Model.Count() > 0)
{
    <h3>
        Integration Info
    </h3>
    <p>
        @{
            var integrationVersionViewModel = Model.FirstOrDefault();


            if (integrationVersionViewModel != null)
            {
                <p><b>Integration Name:</b>  @integrationVersionViewModel.IntegrationName</p>
                <p><b>ProductUpgradeCode:</b>  @integrationVersionViewModel.ProductUpgradeCode</p>
            }
        }
    </p>
    <p>
        @Html.ActionLink("Create New Integrationversion", "CreateVersion", new {id = integrationVersionViewModel.Id})
    </p>
    <table>
        <tr>
           
            <th>
                @Html.DisplayNameFor(model => model.ProductId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Version)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Description)
            </th>
           @* <th>
                @Html.DisplayNameFor(model => model.SettingCount)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DeploymentCount)
            </th>*@
            
            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
               
                <td>
                    @Html.DisplayFor(modelItem => item.ProductId)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Version)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
               @* <td>
                    @Html.DisplayFor(modelItem => item.SettingCount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.DeploymentCount)
                </td>*@
                
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.Id }) |
                    @Html.ActionLink("Settings", "Index", "IntegrationVersionSetting", new {id = item.Id}, null) |
                    @Html.ActionLink("Delete", "Delete", new { item.Id })|
                    @Html.ActionLink("Deployments", "Index", "DeploymentLog", new {item.Id}, null)|
                     @Html.ActionLink("Export", "ExportToFile", new { id = item.Id }) 

                </td>
            </tr>
        }

    </table>
}
else
{
    @Html.ActionLink("Create New Integrationversion", "CreateVersion", new {productupgradecode = ViewBag.productupgradecode})
}